
#include "IO.h"
#include "BSP_Door.h"
#include "BSP_Config.h"

static const IO_T doorLock = {(void*)DOOR_GP, DOOR_PIN};

void BSP_Door_Init(void){
	IO_Init(&doorLock, IO_Mode_OUT);
	BSP_Door_Control(RELAY_S_CLOSE);
}

void BSP_Door_Control(uint8_t state){
	IO_Set(&doorLock, state);
}

uint8_t BSP_Door_State(void){
	return IO_Get(&doorLock) ?  RELAY_S_OPEN : RELAY_S_CLOSE;
}


